package com.demo.study.behavior.inbound.handler;

import com.demo.study.behavior.inbound.Handler;
import com.demo.study.behavior.inbound.dto.InboundApplication;

import java.util.List;

/**
 * 普通执行者
 *
 * @author Baymax
 * @since 2022/3/25
 */
public class NormalHandler implements Handler {
    private List<InboundApplication> applications;

    public NormalHandler(List<InboundApplication> applications) {
        this.applications = applications;
    }

    @Override
    public boolean needExecute() {
        return applications.size() > 0;
    }

    @Override
    public void execute(List<String> businessIds) {
        System.out.println("正常执行数据：" + String.join(",", businessIds));
        System.out.println(applications);
    }

    @Override
    public List<InboundApplication> getApplications() {
        return applications;
    }
}
